<!DOCTYPE html>
<#assign base=request.contextPath />
<html>
<head>
  <base href="${base}">
  <meta charset="utf-8">
  <title>在线考试系统-评分</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${base}/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="${base}/css/global.css" media="all">
  <link rel="stylesheet" href="${base}/css/style.css" media="all">
  <link rel="stylesheet" href="${base}/codemirror/lib/codemirror.css">
  <style>
  .layui-card-header {
  	height: auto;
  	line-height: 26px;
  }
  .my-input {
  	height: 30px;
    #D2D2D2!important;
    padding-left: 10px;
  }
  </style>
</head>

<body>

<div class="layui-form layui-main alone-items" style="margin-top:20px;">
	<div class="layui-row layui-col-space20">
		<div class="layui-col-md12">
			<img style="height:400px" src="${base}/file/${data.idx}.jpg">
		</div>
		
		<div class="layui-col-md12">
			<div class="layui-card">
				<div class="layui-card-header"><strong>第1题： </strong>${data.t1.content}</div>
				<div class="layui-card-body">
					<textarea id="code1">${data.answer1!}</textarea>
				</div>
			</div>
		</div>

		<div class="layui-col-md12">
			<img style="height:400px" src="${base}/file/HQL.jpg">
		</div>
		<div class="layui-col-md12">
			<div class="layui-card">
				<div class="layui-card-header">
					<strong>第2题： </strong>已知上图实体类，请使用HQL完成下面问题：（30分）
					<#list data.t2 as d>
						${d.content}
					</#list>
				</div>
				<div class="layui-card-body">
					<textarea id="code2">${data.answer2!}</textarea>
				</div>
			</div>
		</div>
		
		<div class="layui-col-md12">
			<div class="layui-card">
				<div class="layui-card-header">
					<strong>第3题： </strong>使用Spring AOP实现一个日志切面，拦截com.xju.service包下所有public方法，<br>
					输出：什么时间调用了某方法，参数是什么，结果是什么，执行多长时间。（30分）
				</div>
				<div class="layui-card-body">
					<textarea id="code3">${data.answer3!}</textarea>
				</div>
			</div>
		</div>
		
		<div class="layui-form-item layui-layout-admin">
            <div class="layui-input-block">
              <div class="layui-footer" style="left:0;padding:10px;text-align:center;z-index: 999;">
              	最终得分：<input type="number" name="score" lay-verify="required" class="my-input" placeholder="输入成绩">
              </div>
            </div>
      	</div>
      	
      	<div class="layui-form-item layui-hide">
      		<input type="hidden" name="oid" value="${data.oid}">
	      	<input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="确认提交">
	    </div>
      	
	</div>
</div>

<script src="${base}/js/lib/jquery-1.11.3.min.js"></script>
<script src="${base}/js/commons.js"></script>
<script src="${base}/layuiadmin/layui/layui.js"></script>
<script src="${base}/codemirror/lib/codemirror.js"></script>
<script src="${base}/codemirror/mode/clike/clike.js"></script>
<script src="${base}/codemirror/addon/selection/active-line.js"></script>

<script>
layui.use(['util', 'layer', 'form'], function(){
    var $ = layui.$;
    var util = layui.util;
    var layer = layui.layer;
    var form = layui.form;
    
    $('textarea').each(function(elm) {
    	CodeMirror.fromTextArea(this, {
      	  mode: "text/x-java",
      	  styleActiveLine: true,
      	  lineNumbers: true,
      	  readOnly: 'nocursor', //只读
      	  lineWrapping: true
     	});    	
    });  
	
	//监听提交
	form.on('submit(LAY-form-submit)', function(data) {
  		var index = parent.layer.getFrameIndex(window.name);      		
  		$$.ajax({
  			url: '${base}/exam/student/saveScore',
  			data: data.field,
  			success: function(json) {
  				parent.layui.table.reload('LAY-table');
  	      		parent.layer.close(index);
  			}
  		});
	});
});
</script>

</body>
</html>


